<?php
/**
 * Groups module for XOOPS
 *
 * You may not change or alter any portion of this comment or credits
 * of supporting developers from this source code or any supporting source code 
 * which is considered copyrighted (c) material of the original comment or credit authors.
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 *
 * @copyright       The Groups Project http://code.google.com/p/groupsforxoops/
 * @license         http://www.fsf.org/copyleft/gpl.html GNU public license
 * @package         groups
 * @since           2.3.0
 * @author          Hui Xiao < xh.8326@gmail.com >
 * @version         $Id: action.module.php Sat Jul 18 12:57:20 CST 2009
 */

if (false === defined("XOOPS_ROOT_PATH")) {exit();}

function xoops_module_install_groups(&$module){
    if ( !file_exists(XOOPS_UPLOAD_PATH."/group.gif") ) {
        @copy(XOOPS_ROOT_PATH."/modules/groups/images/group.gif",XOOPS_UPLOAD_PATH."/group.gif");
    }
    $GLOBALS['xoopsDB']->queryFromFile(XOOPS_ROOT_PATH . "/modules/" . $module->getVar("dirname") . "/sql/mysql.data.sql");
    return true;
}

function xoops_module_update_groups(&$module){
    
    $query = "ALTER TABLE `".$GLOBALS['xoopsDB']->prefix("groups_groups")."`  ADD `group_notice` varchar(255) NOT NULL ;";
    $GLOBALS['xoopsDB']->queryF($query);
    return true;
}

function xoops_module_uninstall_groups(&$module) {
    return true;
}